/*
 * Trace.h
 *
 *  Created on: 2013.01.12.
 *      Author: Thg
 */

#ifndef TRACE_H_
#define TRACE_H_

#ifdef DEBUG

#include <stdio.h>
#include <iostream>
#include <assert.h>

#define traceDebug(...) \
{ \
	std::cout<<"DEBUG "<<__FILE__<<":"<<__LINE__<<"\t"; \
	printf(#__VA_ARGS__); \
	std::cout<<std::endl; \
}

#define traceMethod() \
{ \
	std::cout<<"METHO "<<__FILE__<<":"<<__LINE__<<"  "<<__PRETTY_FUNCTION__<<std::endl; \
}

//Everything after the expression will be taken as a string, for example traceAssert(false, Not implemented!);
#define traceAssert(expr, ...) \
{ \
	std::cout<<"ASSER "<<__FILE__<<":"<<__LINE__<<"\t"<<#__VA_ARGS__<<std::endl; \
	assert(expr); \
}

#else

#define traceDebug(...)
#define traceMethod()
#define traceAssert(expr, ...)

#endif

#endif /* TRACE_H_ */
